home *** CD-ROM | disk | FTP | other *** search
- global gMasterObj, gCarObj, gGamesMasterObj, myGridArray, noWayBubList, locateBubList, policeBubList, jailBubList, BLOCKWIDTH, BLOCKHEIGHT, RADARSPRITES, BANDSPRITES, CARSPRITE, POLICESPRITES, BUBBLESPRITES, CURSORINDEX, COUNTDOWNSTRIP, LIFESPRITE
-
- on startMovie
- autoUnloadMovie(gMasterObj)
- set the actorList to []
- set noWayBubList to []
- set locateBubList to []
- set policeBubList to []
- set jailBubList to []
- set BLOCKWIDTH to 40
- set BLOCKHEIGHT to 40
- set RADARSPRITES to 2
- set BANDSPRITES to 17
- set CARSPRITE to 30
- set POLICESPRITES to 25
- set BUBBLESPRITES to 32
- set LIFESPRITE to 37
- set COUNTDOWNSTRIP to 38
- set CURSORINDEX to the memberNum of member "startCursor"
- set nENDx to [0, 0, 1, 0]
- set eENDx to [0, 0, 0, 1]
- set sENDx to [1, 0, 0, 0]
- set wENDx to [0, 1, 0, 0]
- set nwCRN to [0, 1, 1, 0]
- set neCRN to [0, 0, 1, 1]
- set seCRN to [1, 0, 0, 1]
- set swCRN to [1, 1, 0, 0]
- set nWALL to [0, 1, 1, 1]
- set eWALL to [1, 0, 1, 1]
- set sWALL to [1, 1, 0, 1]
- set wWALL to [1, 1, 1, 0]
- set nsCOR to [1, 0, 1, 0]
- set ewCOR to [0, 1, 0, 1]
- set OPENx to [1, 1, 1, 1]
- set SHUTx to [0, 0, 0, 0]
- set r01 to [SHUTx, SHUTx, nENDx, SHUTx, nENDx, SHUTx, nENDx, SHUTx, nENDx, SHUTx, nENDx, SHUTx, nENDx, SHUTx]
- set r02 to [SHUTx, wENDx, OPENx, ewCOR, sWALL, ewCOR, sWALL, nWALL, sWALL, nWALL, sWALL, ewCOR, OPENx, eENDx]
- set r03 to [SHUTx, SHUTx, nsCOR, SHUTx, SHUTx, SHUTx, SHUTx, nsCOR, SHUTx, nsCOR, SHUTx, SHUTx, nsCOR, SHUTx]
- set r04 to [SHUTx, nwCRN, sWALL, ewCOR, ewCOR, nWALL, ewCOR, OPENx, ewCOR, sWALL, ewCOR, ewCOR, OPENx, eENDx]
- set r05 to [wENDx, eWALL, SHUTx, SHUTx, SHUTx, nsCOR, SHUTx, nsCOR, SHUTx, SHUTx, SHUTx, SHUTx, nsCOR, SHUTx]
- set r06 to [SHUTx, nsCOR, SHUTx, nENDx, SHUTx, nsCOR, SHUTx, nsCOR, SHUTx, SHUTx, nENDx, SHUTx, wWALL, eENDx]
- set r07 to [wENDx, eWALL, SHUTx, wWALL, ewCOR, OPENx, ewCOR, OPENx, ewCOR, nWALL, sWALL, ewCOR, eWALL, SHUTx]
- set r08 to [SHUTx, wWALL, ewCOR, eWALL, SHUTx, nsCOR, SHUTx, sENDx, SHUTx, nsCOR, SHUTx, SHUTx, sENDx, SHUTx]
- set r09 to [SHUTx, sENDx, SHUTx, sENDx, SHUTx, sENDx, SHUTx, sENDx, SHUTx, swCRN, eENDx, SHUTx, sENDx, SHUTx]
- set myGridArray to [r01, r02, r03, r04, r05, r06, r07, r08, r09]
- end
-
- on setUpGame
- set gGamesMasterObj to new(script "gamesMasterScript")
- init(gGamesMasterObj, [50.30000000000000426, 28.70000000000000284, 16.40000000000000213, 9.40000000000000036, 5.40000000000000036, 3.10000000000000009, 1.80000000000000004, 1], pickRandamLocs())
- toggleGamePuppets(1)
- gameReset()
- end
-
- on gameReset
- killLastGame(1)
- set gCarObj to new(script "carScript")
- init(gCarObj, 8, 9, CARSPRITE, 5)
- checkCar(gCarObj, 1)
- startTimer()
- end
-
- on toggleGamePuppets puppetState
- puppetSprite(COUNTDOWNSTRIP, puppetState)
- puppetSprite(LIFESPRITE, puppetState)
- repeat with i = RADARSPRITES to RADARSPRITES + 14
- puppetSprite(i, puppetState)
- end repeat
- repeat with i = BANDSPRITES to BANDSPRITES + 7
- puppetSprite(i, puppetState)
- end repeat
- end
-
- on killLastGame killCar
- if not killCar then
- if count(the actorList) > 2 then
- set howMany to count(the actorList)
- repeat with i = 3 to howMany
- destroy(getAt(the actorList, 3))
- end repeat
- end if
- else
- if count(the actorList) > 1 then
- set howMany to count(the actorList)
- repeat with i = 2 to howMany
- destroy(getAt(the actorList, 2))
- end repeat
- end if
- set gCarObj to 0
- end if
- end
-
- on pickRandamLocs
- set mysteryLocList to []
- set bigList to [[3, 1], [5, 1], [7, 1], [9, 1], [11, 1], [13, 1], [2, 2], [14, 2], [14, 4], [1, 5], [4, 6], [11, 6], [14, 6], [1, 7], [2, 9], [4, 9], [6, 9], [11, 9]]
- repeat with i = 1 to 8
- set newLoc to getAt(bigList, random(count(bigList)))
- append(mysteryLocList, newLoc)
- deleteAt(bigList, getOne(bigList, newLoc))
- end repeat
- return mysteryLocList
- end
-
- on keyDown
- if the actorList <> [] then
- set the keyPressed of gGamesMasterObj to the keyCode
- end if
- end
-
- on keyUp
- if the actorList <> [] then
- set the keyPressed of gGamesMasterObj to 0
- end if
- end
-
- on customWait flag, seconds
- set the timer to the timer - (seconds * 60)
- set theTime to the timer
- repeat while (the timer - theTime) < (seconds * 60)
- if flag then
- updateStage()
- end if
- end repeat
- end
-
- on toggleFreezeCar state
- set the freezedCar of gCarObj to state
- end
-
- on clearedPolice
- if the policeCounter of gGamesMasterObj = 0 then
- return 1
- end if
- return 0
- end
-
- on cleanMeUp
- set the actorList to []
- go(1, "BlueMenu")
- end
-
- on stopMovie
- set the actorList to []
- end
-